import { createApp } from "vue";
import App from "./App.vue";
import pinia from "./store";
import router from "./router";
import "virtual:svg-icons-register";
import "element-plus/dist/index.css";
import "element-plus/theme-chalk/dark/css-vars.css";
import "@/styles/dark.scss";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
import SvgIcon from "@/components/SvgIcon/index.vue";
// 导入 SVG 图标
import './icons/index'
import 'virtual:svg-icons-register'
// 导入设备检测store
import { useDeviceStore } from "@/store/modules/device";

const app = createApp(App);
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}
// 全局注册 svg-icon 组件
app.component('SvgIcon', SvgIcon)

app.use(pinia);
app.use(router);

// 初始化设备检测
const deviceStore = useDeviceStore();
deviceStore.setupResizeListener();

app.mount("#app");